<template>
  <div>
    <div class="container">
      <div class="row">
        <div class="col-12 col-sm-9 col-md-7 col-lg-5 m-auto pt-5">
          <div class="card mt-5">
            <div class="card-header text-center bg-white">
              <h3 class="mb-0 text-secondary">{{$myConfig.logo}}</h3>
            </div>
            <div class="card-body">
              <el-form :model="form" :rules="rules" ref="ruleForm">
                <el-form-item prop="username">
                  <el-input v-model="form.username" size="medium" placeholder="请输入用户名"></el-input>
                </el-form-item>
                <el-form-item prop="password">
                  <el-input v-model="form.password" size="medium" type="password" placeholder="请输入用户名密码"></el-input>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" class="w-100" @click="logo">立即登录</el-button>
                </el-form-item>
              </el-form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name:'Login',
  data() {
    return {
      form: {
        username: '',
        password: ''
      },
      rules: {
        username: [{required: true, message: '请输入用户名', trigger: 'blur'}],
        password: [{required: true, message: '请输入用户名密码', trigger: 'blur'}]
      }
    }
  },
  methods: {
    logo(){
      this.$refs['ruleForm'].validate((valid) => {
        if (valid) {
          this.$notify({
            title: '提示',
            message: '登录成功',
            type: 'success'
          });
        } else {
          return false;
        }
      });
    }
  }
}
</script>

<style scoped>

</style>